#include "../bulk_storage/bulk_storage.h"
#include "../m_tree/mTree.h"
#include "../query_handler/query_handler.h"
#include "aa_bond_neighborhood.h"

struct calc_neighborhoods {
  struct store * atomStore;
  struct mTree * atomTree;
  struct filter_state filterState;
  double neighborhoodRadius;
  off_t  storePosition;
  char pdbCode[4];
};


struct calc_neighborhoods * calc_neighborhoods_alloc(struct store * atomStore,
                                                     struct mTree * atomTree,
                                                     double neighborhoodRadius,
                                                     char * pdbCode);
void calc_neighborhoods_free(struct calc_neighborhoods * n) ;
int calc_neighborhoods_next(struct calc_neighborhoods * n, struct aa_bond_neighborhood * neighborhood);
void calc_neighborhoods(char * pdbCode, double neighborhoodRadius,
                        struct store * atomStore, struct mTree * atomTree,
                        struct store * neighStore, struct mTree * neighTree);
